# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Allan McRae <mcrae_allan@hotmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=gnome-mplayer
pkgver=1.0.9
pkgrel=8
pkgdesc='GTK/Gnome interface around MPlayer'
arch=('loong64' 'x86_64')
url='https://sites.google.com/site/kdekorte2/gnomemplayer'
license=('GPL')
depends=('dbus-glib' 'libgda' 'libgpod' 'libnotify' 'gmtk')
makedepends=('caja' 'nautilus' 'nemo' 'python')
optdepends=('caja: file manager integration for Caja'
            'nautilus: file manager integration for Nautilus'
            'nemo: file manager integration for Nemo')
source=("$pkgname-$pkgver.tar.gz::https://github.com/kdekorte/$pkgname/archive/v$pkgver.tar.gz"
        "gnome-mplayer.appdata.xml"
        "caja.patch")
sha256sums=('07e11bc42834dae14ad66f887e6045f2bea94eae7f797b624c9a099f806b5cde'
            '2e661347fa2765a9553938db9582a833b42385db92f6687172507deecf404567'
            '52dbf11e64042c03ec94677ee667d88306f5f45521b7a1da82e5e5f02f59ed28')

prepare() {
  cd $pkgname-$pkgver
  patch -Np0 -i ../caja.patch
  sed -i 's/Exec=gnome-mplayer %U/Exec=gnome-mplayer %F/' $pkgname.desktop
  sed -i '/AM_GCONF_SOURCE_2/d' configure.in
  autoreconf -fi
}

build() {
  cd $pkgname-$pkgver
  CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 ../gnome-mplayer.appdata.xml "$pkgdir/usr/share/metainfo/gnome-mplayer.appdata.xml"
}
